#!/bin/bash

led_red=/sys/class/leds/led-red/brightness
led_blue=/sys/class/leds/led-blue/brightness
led_green=/sys/class/leds/led-green/brightness
led_1=/sys/class/leds/led_usr1/brightness
led_2=/sys/class/leds/led_usr2/brightness
led_3=/sys/class/leds/led_usr3/brightness

# 定义LED操作函数
toggle_led() {
    sudo chown seeed "$1"
    echo 1 > "$1"
    sleep 0.2
    echo 0 > "$1"
    sleep 0.2
}

# 交替点亮和熄灭LED灯
while [ 1 ]
do
    toggle_led "$led_red"
    toggle_led "$led_green"
    toggle_led "$led_blue"
    toggle_led "$led_1"
    toggle_led "$led_2"
    toggle_led "$led_3"
done

